<%@ Page Language="C#" MasterPageFile="~/Master/PlacementManager.master" Theme="YUI"
    StylesheetTheme="YUI" AutoEventWireup="true" CodeFile="ManageAttendancePatterns.aspx.cs"
    Inherits="Home_ManagePlacementCategory" Title="PlacementManager: Categories" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="yui-b">
                
            </div>
            <div id="yui-main">
                <div class="yui-b">
                    <h1>Manage Attendance Patterns</h1>
                    <p>
                        Use this form to manage the available attendance patterns that can be associated
                        with a placement type. Atendance patterns are School or Division specific.</p>
                    <asp:GridView ID="gvAttendancePatterns" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        DataSourceID="odsAttendancePattern" SkinID="Results" OnRowUpdating="gvAttendancePatterns_RowUpdating"
                        AllowSorting="True" DataKeyNames="AttendancePatternId">
                        <Columns>
                            <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/Icons/against.gif"
                                EditImageUrl="~/Images/Icons/edit.gif" ShowEditButton="True" UpdateImageUrl="~/Images/Icons/refresh.gif" />
                            <asp:BoundField DataField="AttendancePatternName" HeaderText="Name" SortExpression="AttendancePatternName" />
                            <asp:BoundField DataField="CreatedBy" HeaderText="Created By" SortExpression="CreatedBy"
                                ReadOnly="True" />
                            <asp:BoundField DataField="DateCreated" HeaderText="Date Created" SortExpression="DateCreated"
                                ReadOnly="True" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                            <asp:BoundField DataField="UpdatedBy" HeaderText="Updated By" SortExpression="UpdatedBy"
                                ReadOnly="True" />
                            <asp:BoundField DataField="DateUpdated" HeaderText="Date Updated" SortExpression="DateUpdated"
                                ReadOnly="True" DataFormatString="{0:dddd d MMMM yyyy}" HtmlEncode="False" />
                        </Columns>
                        <EmptyDataTemplate>
                            No placement categories have been defined for this Division.
                        </EmptyDataTemplate>
                    </asp:GridView>
                    <hr style="height: 1px;" />
                    <span class="formLabel">New Attendance Pattern Name:</span>
                    <asp:TextBox ID="txtNewAttendancePatternName" runat="server" MaxLength="255"></asp:TextBox>&nbsp;<asp:Button
                        ID="btnAddNewAttendancePattern" runat="server" CssClass="inputbutton" OnClick="btnAddNewAttendancePattern_Click"
                        Text="Add New Attendance Pattern" />&nbsp;
                    <asp:Label ID="lblNewAttendancePatternMessage" runat="server"></asp:Label>
                </div>
            </div>
            
        </ContentTemplate>
    </asp:UpdatePanel>
    <!--Object Data Sources ************************************************* -->
    <asp:ObjectDataSource ID="odsAttendancePattern" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="SelectAllWDivisionId" TypeName="PlacementManager.AttendancePatternComponent"
        SortParameterName="sortExpression" DataObjectTypeName="PlacementManager.AttendancePattern"
        DeleteMethod="DeleteAllWDivisionId" InsertMethod="Insert" UpdateMethod="Update">
        <SelectParameters>
            <asp:SessionParameter Name="DivisionId" SessionField="DivisionId" Type="Int32" />
            <asp:Parameter DefaultValue="AttendancePatternName" Name="sortExpression" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="DivisionId" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="AttendancePatternName" Type="String" />
            <asp:Parameter Name="DivisionId" Type="Int32" />
            <asp:Parameter Name="IsActive" Type="Boolean" />
            <asp:Parameter Name="DateCreated" Type="DateTime" />
            <asp:Parameter Name="CreatedBy" Type="String" />
            <asp:Parameter Name="DateUpdated" Type="DateTime" />
            <asp:Parameter Name="UpdatedBy" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>
